const express = require('express');

const cors = require('cors');
const bodyParser = require('body-parser');
const student = require('./router/student');
// 引入数据库
const db = require("./db/index");
const usersRouter = require("./router/user");
const app = express();

app.use(express.static('public'));
app.use(cors());
app.use(bodyParser.urlencoded({extended:true}));
app.use(student);
app.use(usersRouter);
app.listen(3000,err=>{
    if(!err){
        console.log('服务器启动');
    }else{
        console.log(err);
    }
})